#pragma once



#include <QLabel>
#include <QWidget>
#include <QDebug>
#include <QMouseEvent>
#include <functional>
#include <QToolTip>
#include <QPoint>

#include <lv_api.h>

#include "singleton.h"
#include "Json.h"

#define SCALAR      0.5
#define SCALARMAX   2

class NewQLabel : public QLabel
{
public:
    NewQLabel(QWidget * parent = nullptr);
    ~NewQLabel();

    void mousePressEvent(QMouseEvent * event);

    // void mouseMoveEvent(QMouseEvent * event);

    void mouseDoubleClickEvent(QMouseEvent * event);

    void setCallBack(std::function<void(void)> cb) {m_cb = cb;}

    void setData(std::shared_ptr<lv::lvmat::LvMat> & src)
    {
        m_mat = src;
    }

    void setFullScreen(bool value) {m_isFullScreen = value;}


private:
    std::function<void(void)>           m_cb;
    std::shared_ptr<lv::lvmat::LvMat>   m_mat;
    bool                                m_isFullScreen = false;
    
public:
    static QPoint                       curPos;
};

